<?php

//url index.php?file=filename&pars=p1

//dafault set
include_once("configs/base.inc.php");

//add smarty application
include_once("configs/smarty.inc.php");

//echo $_SERVER['QUERY_STRING'];
//print_r($_SERVER); 

//main portal
if(!ereg("index.php",$_SERVER['REQUEST_URI'])){
	header("Location:index.php");
	exit;
}else{
	if(empty($_SERVER['QUERY_STRING'])){
		include_once("applications/index.php");	
		exit;
	}else{
		//处理控制器
		$controller = $_GET['controller'];
		//if($controller == "admin"){
		//	include_once("applications/admin/".$controller.".php");	
		//	exit;
		//}else{
			include_once("applications/".$controller.".php");
			exit;
		//}
	}
}
?>